06. Step by Step Guide - React Apps
Step by Step Guide for Building the MyReads App
Planning Stage 📐
Step 1 - Draw All of the Views of the App
We need to determine the look and functionality of each view in your app. One of the best approaches is to draw each view of the app on paper so that you'll have a good idea of what information and data you're planning to have on each page.
Instead of paper and pencil, you can be a bit more digital and use software for creating mockups. If you were given project specifications, check your mock against them to make sure that you have all of the required features. For the exercises that follow, your can just draw what you're trying to create on paper.
Task Feedback:
Great job! Doing this work in the beginning will help you approach the project in a logical, structured way.
Step 2 - Break Each View Into a Hierarchy of Components
For this step,
- draw boxes around every component; and
- arrange our components into a hierarchy
Task Feedback:
Good! How do you know if something should be a component in React?
Step 3 - Determine the Data Each Component Needs
For each component, determine which data is the component accessing, getting, modifying, or showing.
Task Feedback:
Right on!
Step 4 - Determine Which Component Each Piece of Data Should Live in
If multiple components need the same data, lift the state up by storing the data in the components' closest common ancestor. Take a look at these example to see how that's done: Lifting State Up and Thinking in React.
Task Feedback:
Great! By doing all of the planning upfront, you've saved yourself hours of debugging time!
Coding Stage🔨
Step 1 - Create components that hold data.
Build all of the components that hold data and make sure everything works correctly, including API calls (e.g. the components request data the correct way and the data comes in as expected.)
Task Feedback:
Good job!
Step 2 - Create components that need data.
Task Feedback:
Way to go!
Step 3 - Pass data from components that have it to components that need it.
Task Feedback:
Good work!
Step 4 - Debug and make sure that everything works as expected.
Task Feedback:
Very good! Making sure you're testing any major changes will save you a lot of debugging time later on.
Step 5 - Add inverse data flow (if you're confused about what that means, take a look at this.
Task Feedback:
You've created a pretty powerful app!
Step 6 - Add navigation.
Step 7 - Add finishing touches and make sure the project meets the rubric.
Remember, this is just a template. As you build more projects, you'll modify this template to suit your needs. You may also find it more intuitive to use a different approach. Regardless of the approach you take, however, planning out your app is imperative to success.
Task Feedback:
Great work! Go ahead and submit your project. Our reviewers look forward to helping you honing your development skills.